<!--
 * @Descripttion: 
 * @version: 1.0
 * @Author: Sam
 * @Date: 2021-12-01 09:57:01
 * @LastEditors: Sam
 * @LastEditTime: 2021-12-01 10:24:24
-->
{include file="public/header" /}
<div class="login_bg" style="height: 100%;">
    <div class="login">
        <div class="title">管理登录</div>
        <div class="dark_banner_wrap"></div>
        <form class="layui-form" action="">
            <input name="username" placeholder="用户名" type="text" lay-verify="required" autocomplete="off" class="layui-input login_input">
            <div class="h15"></div>
            <input name="password" placeholder="密码" type="password" lay-verify="required" autocomplete="off" class="layui-input login_input">
            <div class="h15"></div>
            <button class="layui-btn login_btn" lay-submit="">登录</button>
            <div class="h15"></div>
        </form>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form'], function(){
        var $    = layui.$;
        var form = layui.form;

        form.render();

        // 登录
        form.on('submit()', function(data){
            Post('', data.field, function(res) {
                if (res.code == 1) {
                    tips_success(res.msg, function() {
                        location.href = '{:url("Index/index")}';
                    });
                } else {
                    alert_error(res.msg);
                }
            });
            return false;
        });
    });
</script>
